<template>
  <div class="lsc-mycenter">
    <div class="my_header_v4_wrap">
      <div class="my_header_v4">
        <div class="my_header_v4_main" id="myHeader">
          <div class="my_header_v4_avatar">
              <div class="my_header_v4_avatar_img">
                <!-- <img :src="baseInfo.head"  /> -->
                <img src="../../assets/head.jpg"  />
              </div>
          </div>
          <div class="my_header_v4_msg">
            <div class="my_header_v4_name">
              <span class="my_header_v4_name_text" data-tag="editNameSpan">{{baseInfo.name}}</span>
              <i class="my_header_v4_name_edit" data-tag="editNamei"></i>
            </div>
            <div class="my_header_v4_pin" id="userName" data-pin="chenleson">{{baseInfo.mobileno}}</div>

          </div>
          <router-link class="my_header_v4_settings" to="/info">账号管理</router-link>
        </div>
      </div>
    </div>

    <section class="my_section">
      <div class="my_order">
        <router-link class="my_order_entrances" to="/orders?tapid=1">
          <van-icon  name="balance-details" :info="baseInfo.dfk_order_num.toString()"/><span>待付款</span>
        </router-link>
        <router-link class="my_order_entrances" to="/orders?tapid=2">
          <van-icon name="pending-orders" /><span>待审核</span>
        </router-link>
        <router-link class="my_order_entrances" to="/orders?tapid=3">
          <van-icon name="completed" /><span>已审核</span>
        </router-link>
        <router-link class="my_order_entrances" to="/orders">
          <van-icon name="description" /><span>全部订单</span>
        </router-link>
      </div>
    </section>
    
    <section class="my_section">
      <van-cell-group>
        <van-cell class="lsc-mycenter-icon" icon="member-day-privilege" to="/member" is-link>
          <template slot="title">
            <span class="van-cell-text">我的会员</span>
          </template>
        </van-cell>
        <van-cell class="lsc-mycenter-icon" icon="gold-coin" to="/asset" is-link>
          <template slot="title">
            <span class="van-cell-text">财务管理</span>
          </template>
        </van-cell>
        <van-cell class="lsc-mycenter-icon" icon="cash-back-record" to="/account" is-link>
          <template slot="title">
            <span class="van-cell-text">我的帐户</span>
          </template>
        </van-cell>
        <van-cell class="lsc-mycenter-icon" icon="records" to="/news" is-link>
          <template slot="title">
            <span class="van-cell-text">资讯公告</span>
            <van-tag type="danger" v-if="baseInfo.news_num">{{baseInfo.news_num}}</van-tag>
          </template>
        </van-cell>
        <van-cell class="lsc-mycenter-icon" icon="contact" to="/info" is-link>
          <template slot="title">
            <span class="van-cell-text">个人信息</span>
          </template>
        </van-cell>
      </van-cell-group>
    </section>
    <div style="clear:both"></div>
    <van-tabbar v-model="active">
      <van-tabbar-item icon="shop" to="/main">首页</van-tabbar-item>
      <van-tabbar-item icon="cart" :info="baseInfo.cart_num.toString()" to="/cart">购物车</van-tabbar-item>
      <van-tabbar-item icon="contact"  to="/mycenter">我</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
// import api from '../../api'
import { mapGetters } from  'vuex'

export default {
  name: 'center',
  computed: {
    ...mapGetters({
      active: 'getTabbarActive',
      baseInfo: 'getBaseInfo'
    })
  },
  activated: function () {
    // 获取底部导航激活索引
    this.$store.dispatch('fetchTabbarActive', 2)
  }
}
</script>

<style>
.lsc-mycenter-icon .van-icon-member-day-privilege:before,
.lsc-mycenter-icon .van-icon-records:before,
.lsc-mycenter-icon .van-icon-contact:before,
.lsc-mycenter-icon .van-icon-gold-coin:before,
.lsc-mycenter-icon .van-icon-cash-back-record:before {
  color: #38f;
}
.my_header_v4_wrap {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fff
}
.my_header_v4_settings {
  color: #fff;
}
.my_header_v4_wrap .my_header_v4 {
    overflow: hidden;
    position: relative;
    border-radius: 6px;
    font-size: 12px;
    color: #fff;
    background: -webkit-linear-gradient(left,#946fd9,#5f425d);
    /* background:linear-gradient(90deg,#eb3c3c,#ff7459); */
    box-shadow: 0 2px 5px rgba(255,98,98,.4);
}

.my_header_v4_wrap .my_header_v4.bg_gold {
    background: -webkit-linear-gradient(left,#dd9b4c,#ffd787);
    background: linear-gradient(90deg,#dd9b4c,#ffd787);
    box-shadow: 0 2px 5px #f8e3c6
}

.my_header_v4_wrap .my_header_v4.bg_gold .my_header_v4_link,.my_header_v4_wrap .my_header_v4.bg_gold .my_header_v4_vip {
    background-color: rgba(180,116,15,.3)
}

.my_header_v4_wrap .my_header_v4_main {
    position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 25px 15px
}

.my_header_v4_wrap .my_header_v4_avatar {
    position: relative;
    margin-right: 10px;
    width: 60px;
    height: 60px;
    border: 1px solid hsla(0,0%,100%,.4);
    border-radius: 60px;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
    background: #fff;
}

.my_header_v4_wrap .my_header_v4_avatar img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 60px
}

.my_header_v4_wrap .my_header_v4_avatar_img {
    overflow: hidden;
    border-radius: 60px;
    padding-top: 100%
}

.my_header_v4_wrap .my_header_v4_avatar_tag {
    position: absolute;
    left: 50%;
    bottom: -3px;
    z-index: 1;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    padding: 0 14px 0 6px;
    height: 15px;
    line-height: 15px;
    border-radius: 15px;
    font-size: 10px;
    white-space: nowrap;
    color: hsla(0,0%,100%,.7);
    background-color: rgba(0,0,0,.5)
}

.my_header_v4_wrap .my_header_v4_avatar_tag::after {
    content: "";
    display: block;
    width: 4px;
    height: 4px;
    border-top: 1px solid hsla(0,0%,100%,.7);
    border-left: 1px solid hsla(0,0%,100%,.7);
    -webkit-transform-origin: 50%;
    transform-origin: 50%;
    -webkit-transform: rotate(135deg);
    transform: rotate(135deg);
    position: absolute;
    right: 6px;
    top: 5px
}

.my_header_v4_wrap .my_header_v4_avatar .my_header_v4_vip {
    white-space: nowrap;
    margin: 0;
    position: absolute;
    bottom: -3px;
    left: 5px
}

.my_header_v4_wrap .my_header_v4_msg {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0
}

.my_header_v4_wrap .my_header_v4_plus {
    position: absolute;
    right: -2px;
    bottom: -8px;
    -webkit-transform: rotate(11deg);
    transform: rotate(11deg);
    padding: 18px 15px 15px 8px;
    border-top-left-radius: 4px;
    box-shadow: -1px -1px 6px #c6934d;
    background-size: 50px
}

.my_header_v4_wrap .my_header_v4_plus_btn {
    position: relative;
    padding: 0 8px 0 5px;
    height: 12px;
    line-height: 12px;
    border-radius: 12px;
    font-size: 7px;
    color: #cead68;
    background-color: hsla(0,0%,85%,.1)
}

.my_header_v4_wrap .my_header_v4_plus_btn::before {
    content: "";
    position: absolute;
    z-index: 1;
    pointer-events: none;
    background-color: #535353;
    border: 1px solid #ddd;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: none;
    border-color: #535353;
    border-radius: 12px
}
.my_section {
    position: relative;
    margin: 15px 0;
    background: #fff
}
.my_order {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex
}

.my_order .my_order_entrances {
    position: relative;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    padding: 42px 0 12px;
    text-align: center;
    font-size: 12px;
    color: #666;
    background: no-repeat center 16px;
    background-size: 20px
}

.my_order .my_order_entrances .van-icon-balance-details,
.my_order .my_order_entrances .van-icon-pending-orders,
.my_order .my_order_entrances .van-icon-completed,
.my_order .my_order_entrances .van-icon-description {
    position: absolute;
    top: 19px;
    left: 39px;
}
.my_order .my_order_entrances .van-icon-balance-details:before,
.my_order .my_order_entrances .van-icon-pending-orders:before,
.my_order .my_order_entrances .van-icon-completed:before {
  font-size: 20px;
  color:#d1961f;
}
.my_order .my_order_entrances .van-icon-description:before {
  font-size: 20px;
  color: #d09f3b;
}

.my_order .my_order_entrances .dot {
    top: 8px;
    left: 50%;
    margin-left: 5px
}
</style>
